home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_073
/
add
/
add.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
5KB
|
112 lines
ADD - create keyboard shortcuts where no keyboard shortcuts have gone before.
Copyright ((c)) 1987, John Russell
This is a small Intuition hack, which I'm surprised not to have seen
anywhere before. It lets you take other people's menus, and customize them
(at least with regards to keyboard equivalents, ie right-Amiga + <key>
combinations). The idea was brought into my consciousness when I saw how
MWB let you circumvent the assumptions made by other programmers in a
transparent way, although it had probably been fermenting back there for a
while :-).
Syntax:
add <windowname> <menunumber> <itemnumber> [ <sub-item number> ] <key | "-kill">
Windowname is the name of the window (no matter what screen it is on) to
which the menu you want to alter is attached. I ran into hassles with
long window titles and those with spaces, so you only need specify the
first word (eg VT100 instead of VT100 (2.4 861214... etc). Note that names
*are* case sensitive.
All numbers are from 1 upwards, so "add window 1 1 X" is the upper-left-hand
position in the menu list.
If you have 5 parameters it assumes the 4th is the position of a sub-item,
not the shortcut itself. Otherwise, the 2nd and 3rd supply the position info
and the 4th is the key to use.
The shortcut can be specified as upper or lower case; they are treated the
same. Note that there is nothing to prevent you from creating duplicate
shortcuts. Since I didn't want to get over-fancy, the size of the menu
hitbox is unaltered and this may cause some (non-harmful) overlapping.
The "-kill" option is position-dependent (it must go last) and just turns
off an existing shortcut.
--------------
Sample uses -
Install this file as s:loadwb (instead of "loadwb", "execute loadwb")
loadwb
until Workbench 60 -m ; wait until window opens and sets menu (also posted)
addbuffers df0: 15
add Workbench 1 1 O
add Workbench 1 2 C
add Workbench 1 3 D
add Workbench 1 4 R
add Workbench 1 5 I
add Workbench 1 6 K ;for kill
add Workbench 2 1 E
add Workbench 2 2 F ;for format
add Workbench 3 4 S
add Workbench 3 5 V
If you use VT100 and don't have a compiler, you might want to install
s:vt100 ("run vt100", then "execute vt100")
until VT100 60 -m ;wait 'til VT100 opens window, sets menu strip
addbuffers df0: 15 ;if none added before
add VT100 1 1 C
add VT100 1 2 A
add VT100 2 1 1 L ;I only use 3/1200 baud
add VT100 2 1 2 H
add VT100 2 1 3 -kill ;because this one was originally "H"
--------------
Bugs/problems:
Using 0 or negative numbers for menu positions is *not* recommended.
Before I added the checks for end-of-menu, I would experience strange
screen displays trying to access menu # 1000, etc. even though it was just
de-referencing the pointers. Anyone know why?
Programs with a space as the first character in the window title (eg
PageSetter) need to be filezapped (change the space to, say, a _).
Programs that re-use parts of the menu structure (eg Ahost); well, it doesn't
hurt, but you can only specify 1 shortcut which shows up several times.
Programs that disable menu operations at various times (eg DPaint and
Workbench) need to be taken case-by-case. I was disappointed about DPaint,
although menu operations *are* allowed once the mouse is above the drawing
area. For Workbench, just allow disk activity to cease before using add.
This was originally interactive, and I just hacked it into "expert" mode
at someone's request. If I ever get more than 10 minutes at a time with it,
I'll combine the two, and hopefully get to use some of the neato features
like ItemAddress and the MenuNumber macro. Be warned, I fully intend to steal
menus away from programs and let you select them in *mine*!
I can't accept responsibility for any damages that may occur as a result
of using this program (although I highly doubt any will happen).
--------------
This program is made available as shareware. Anyone may give it to anyone,
but not impose any conditions in doing so. If you feel that any and/or all
programs you have from me have been worth $5 or so to you, you might want to
send a small donation to:
John Russell
5 Alderdice Place
St. John's, NF, Canada
A1B 2P8
(709) 726-7847
If I get favourable response, I may expand the idea into a general screen/
window/menu management program, allowing you to customize the Intuition-based
features of other people's programs. Hmmm, I wonder what kind of
copyright conundrums *that* might create? "But officer, the spreadsheet I
wrote has *none* of these filthy messages in it..."